Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VPN-6252: Add Daemon Documentation #9741

Merged
merged 7 commits into from
Jul 23, 2024
Merged

Conversation

oskirby
Copy link
Collaborator

@oskirby oskirby commented Jul 22, 2024

Description

We have a need to better document how the daemon works, why we need it, and how it is expected to recover in the event of a crash. This PR should add a new document at docs/Components/daemon.md with the desired details.

Reference

JIRA Issue: VPN-6252

Checklist

  • My code follows the style guidelines for this project
  • I have not added any packages that contain high risk or unknown licenses (GPL, LGPL, MPL, etc. consult with DevOps if in question)
  • I have performed a self review of my own code
  • I have commented my code PARTICULARLY in hard to understand areas
  • I have added thorough tests where needed

@oskirby oskirby marked this pull request as ready for review July 23, 2024 06:24

### Android daemon???

TODO: How does Android work, exactly?
Copy link
Collaborator

@strseb strseb Jul 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Daemon is an Android Service communicating using Bindings with the Client (or widgets). Unlike "standard" android guidelines, it's explicitly a 2nd process.

The protocol is similar to the desktop daemons as we exchange json blobs but the format on the wire is {requestType:int,data:json} (...we could actually think about using the desktop protocol at some point)

To activate the daemon will request a raw handle of a TUN device using Android's VPN API. It load's wireguard-go into it's process and calls into wg-go with the handle and the config, which will then spawn a goroutine handling traffic.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@oskirby oskirby merged commit 6c6a54a into main Jul 23, 2024
113 checks passed
@oskirby oskirby deleted the vpn-6252-add-daemon-documentation branch July 23, 2024 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants